package net.form.processing.classification;

import net.form.processing.ElasticTransformation;
import net.form.processing.GridReferenceObject;

public class ObjectReference {
	private static Double cantPixel=Double.valueOf(ElasticTransformation.getFactor()) * Double.valueOf(GridReferenceObject.getSizeGrid());

	private static Double cantMM = Double.valueOf(GridReferenceObject.getSizeGrid());
	
//	private static Double cant_Pixeles_X_MM;

	private static Double diametroZaranda = 4.76;
	
//	private static ObjetoClasificador referencia;
	
	private static Double errorCalculos;

	/**
	 * Retorna la relacion entre el area en pixeles y el area en milimetros
	 * 
	 * @return
	 */
	public static Double getRelacionPixelMM() {
		// if (getAreaPixel() != null && getAreaCm() != null && getAreaPixel()
		// != 0)
		if (cantPixel != null) {
			return cantMM /cantPixel;
		}
		return 1.0;
	}
//
//	public static void inicializarObjectReference() {
//		
//		cantPixel = 0.0;
//		referencia = null;
//		errorCalculos = 0.0;
//		cant_Pixeles_X_MM = 1.0;
//	}
//	
//	public static void setObjectReference(ObjetoClasificador obj) {
//		
//		cantPixel = obj.getDiametro();
//		referencia = obj;
//		errorCalculos = (obj.getAlto()-obj.getAncho());
//		if (errorCalculos < 0) errorCalculos = errorCalculos*-1;
//		errorCalculos = errorCalculos/cantMM;
//		cant_Pixeles_X_MM = (cantPixel / cantMM);
//	}
	
//	public static Double mayorDiametroEnMM(ObjetoClasificador obj) {
//		if (obj.getHeightInPixel() > obj.getWidthInPixel()) {
//			return obj.getHeight();
//		} else {
//			return obj.getWidth();
//		}
//	}
//	
//	public static boolean isGranoQuebrado(ObjetoClasificador obj){
//		
//		if(ObjectReference.mayorDiametroEnMM(obj) < diametroZaranda) return true;
//		return false;
//	}
//
//	public static Double getCantPixel() {
//		return cantPixel;
//	}
//
//	public static Double getCantMM() {
//		return cantMM;
//	}
//
//	public static Double getCant_Pixeles_X_MM() {
//		return cant_Pixeles_X_MM;
//	}

	public static Double getDiametroZaranda() {
		return diametroZaranda;
	}

//	public static ObjetoClasificador getReferencia() {
//		return referencia;
//	}

	public static Double getErrorCalculos() {
		return errorCalculos;
	}

//	public static void setCantMM(Double cantMM) {
//		ObjectReference.cantMM = cantMM;
//	}

}
